import request from '@/tools/request'

export function hasAdmin() {
  return request({
    url: '/user/hasAdmin',
    method: 'get',
    loading: false
  })
}

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data,
    loading: false
  })
}

export function register(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data,
    loading: false,
    filter: true
  })
}

export function userFindAll(data) {
  return request({
    url: '/user/findAll',
    method: 'post',
    data
  })
}

export function userFindOne(data) {
  return request({
    url: '/user/findOne',
    method: 'post',
    data
  })
}

export function userUpdate(data) {
  return request({
    url: '/user/update',
    method: 'post',
    data
  })
}

export function userRemove(data) {
  return request({
    url: '/user/remove',
    method: 'post',
    data
  })
}

export function userRemoveBatch(data) {
  return request({
    url: '/user/removeBatch',
    method: 'post',
    data
  })
}

